home *** CD-ROM | disk | FTP | other *** search
- /*
- █████████████████████████████████████████████████████████████████████████████
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ KNOW-HOW.SLANG.GRAPHICS ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- █████████████████████████████████████████████████████████████████████████████
-
- This text contain complete description of KNOW_HOW.SLANG.GRAPHICS 5.0x.
- In addition to KNOW_HOW.SLANG and KNOW_HOW.GRAPHICS power it provide the
- following features:
- 1. KNOW-HOW.SLANG.GRAPHICS is the BASIC with access to drawing tools of
- current product (BGI, GDI ...). It provide to user the possibility to
- load graphical resourses (DOS or Windows, or other if he add some code)
- and interprete them in run-time. There are very many applications
- of this tool, like run-time changeable GUI.
- 2. Maketing (without stage of compilation, KNOW-HOW.VECTOR, the
- ready-to-use product of this type, is included) of BGI, GDI and so on
- applications, vector drawing tools.
- 3. Together with BASIC math. functions it could also be used for data
- plotting, spreadsheets and so on.
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ Functions░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- 5.0x version supports following functions:
-
- line(x1,y1,x2,y2)
- lineto(x2,y2)
- moveto(x1,y1)
- ellipse(x,y,stangle,endangle,xr,yr)
- rectangle(l,t,r,b)
- poly(numpoints, POLY), as poly(4, 100,100, 200,200, 200,100, 100,100)
- text(x,y,string)
- color(color)
- set_rgb(r,g,b) // set RGB color
- style(fillstyle, fillcolor)
- textsize(mx,dx,my,dy)
- font("BGI font file name")
- fill(1 or 0) - fill or not closed figures
- zoom(zx, zy)
- addzoom(zx, zy)
- scroll(x, y)
- addscroll(x, y)
- rotate(alpha, x, y)
- setline(width)
- mirror(x), set mirror, all output will be reflected
- rot_on // add rotations to stack for complex rotations
- rot_off // flash stack of rotations
- endrotate // pop last rotation
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ FILES ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ▐▐▐▐▐▐▐ Files OOPIC.H and OOPIC.CPP contains class, derived from Slang and
- KH_Paint.
- ▐▐▐▐▐▐▐ Files USER1.INC and USERLANG.INC are modified to define new operators:
- { "line", LINE },
- { "lineto", LINETO },
- { "ellipse", ELLIPSE },
- { "rectangle", RECTANGLE },
- { "poly", POLY },
- { "text", TXT },
- { "moveto", MOVETO },
- { "color", SETCOLOR },
- { "set_rgb", SETCOLOR_RGB },
- { "style", SETFILLSTYLE },
- { "textsize", SETTEXTSIZE },
- { "font", SETFONT },
- { "fill", SETFILL },
- { "zoom", ZOOM },
- { "addzoom", ADDZOOM },
- { "scroll", SCROLL },
- { "addscroll", ADDSCROLL },
- { "rotate", ROTATE },
- { "setline", SETLINE },
- { "mirror", MIRROR },
- { "rot_on", ROTATE_ON },
- { "rot_off", ROTATE_OFF },
- { "endrotate", ENDROTATE },
- in USERLANG and:
- , LINE = USER + 1, LINETO, ELLIPSE, RECTANGLE, POLY, TXT, MOVETO,
- SETCOLOR, SETCOLOR_RGB, SETFILLSTYLE, SETTEXTSIZE,
- SETFONT, SETFILL,
- ZOOM, ADDZOOM, SCROLL, ADDSCROLL, ROTATE, SETLINE, MIRROR,
- ROTATE_ON, ROTATE_OFF, ENDROTATE
- in USER1.INC
-
- Defines are set in Options/Compiler/Code Generation.
- Example, DOS:
-
- #include <conio.h> // only for interruption on key pressed **************
- class Demo : public OOPic
- {
- virtual void terminate(); // User-defined terminator (ESC and so on)
- };
- /////////////
- void Demo::terminate()
- {
- if(kbhit())
- {
- getch();
- if(kbhit())
- getch();
- serror(23);
- }
- }
-
- void main()
- {
- int gdriver = DETECT, gmode;
- initgraph(&gdriver, &gmode, "");
-
- Demo* basic = new Demo();
- // basic->basic(basic->load_program("oopic.vec"));
- char s[80] = "mirror(0,0)\r\nrotate(0,0,0)\r\nleft=10\r\ntop=10\r\nright=200\r\nbottom=200";
- basic->basic(s);
- char s1[80] = "color(15):style(1,7):header=\"Hello\"font(\"litt.chr\"):textsize(1,1,1,1)";
- basic->basic(s1);
- basic->basic(basic->load_program("window.vec"));
- delete basic;
-
- closegraph();
- }
-
- Example, Windows:
- // This example demonstrates output to OWL window. If necessary,
- // any other Windows library could be used.
-
- #include <owl.h>
- class Demo : public OOPic
- {
- public:
- void demo();
- };
- ///////////////////
- void Demo::demo()
- {
- basic(load_program("oopic.vec"));
- }
- class TMyApp : public TApplication
- {
- public:
- TMyApp(LPSTR AName, HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpCmdLine, int nCmdShow)
- : TApplication(AName, hInstance, hPrevInstance, lpCmdLine, nCmdShow) {};
- virtual void InitMainWindow();
- };
-
- _CLASSDEF(TMyWindow)
- class TMyWindow : public TWindow, public Demo
- {
- public:
- TMyWindow(PTWindowsObject AParent, LPSTR ATitle)
- : TWindow(AParent, ATitle), Demo() { DC = GetDC(HWindow); }
- virtual void WMLButtonDown(RTMessage Msg)
- = [WM_FIRST + WM_LBUTTONDOWN];
- };
-
- void TMyWindow::WMLButtonDown(RTMessage)
- {
- DC = GetDC(HWindow);
- demo();
- }
-
- void TMyApp::InitMainWindow()
- {
- MainWindow = new TMyWindow(NULL, Name);
- }
-
- int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpCmdLine, int nCmdShow)
- {
- TMyApp MyApp("Sample KNOW-HOW.GRAPHICS Program", hInstance, hPrevInstance,
- lpCmdLine, nCmdShow);
- MyApp.Run();
- return MyApp.Status;
- }
-
-
-